﻿<Components:ComponentEditorBase x:Class="Components.Analytics.DocumentClusteringEditor"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:Components="clr-namespace:Components;assembly=Components" 
           xmlns:Controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" 
           xmlns:Liquid="clr-namespace:Liquid;assembly=Liquid.RichText" 
           xmlns:Controls1="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
           Width="Auto" Height="Auto" 
           Title="DocumentClusteringEditor">
    <Grid x:Name="LayoutRoot" Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        
        <StackPanel Orientation="Vertical">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="Task name:"/>
                <TextBox x:Name="txtTaskName" Padding="4" MinWidth="100"/>
            </StackPanel>
            
            <Controls1:Expander Header="Projects" IsExpanded="True">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="4"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="4"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="60"/>
                        <ColumnDefinition Width="4"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="3"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="3"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="3"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="3"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="3"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="3"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="3"/>
                    </Grid.RowDefinitions>
                    
                    <TextBlock Grid.Column="1" Grid.Row="1" 
                               TextAlignment="Right" HorizontalAlignment="Right"
                               Text="DB server:"/>
                    <TextBox Grid.Column="3" Grid.Row="1"
                             Text="localhost" x:Name="txtDbServer"/>
                    
                    <TextBlock Grid.Column="1" Grid.Row="3" 
                               TextAlignment="Right" HorizontalAlignment="Right"
                               Text="Project DB:"/>
                    <TextBox Grid.Column="3" Grid.Row="3"
                             x:Name="txtProjDB" Text="NIHProject" />
                    
                    <TextBlock Grid.Column="1" Grid.Row="5"
                               TextAlignment="Right" HorizontalAlignment="Right"
                               Text="SQL"/>
                    <Liquid:RichTextBox Grid.Column="3" Grid.Row="5" Grid.ColumnSpan="2"
                             x:Name="txtSQL" AcceptsReturn="True" 
                             TextWrapping="Wrap" MinHeight="50" MaxHeight="200"
                             MinWidth="300" MaxWidth="500"/>

                    <Button Grid.Column="4" Grid.Row="7"
                            x:Name="btnParseSQL" Content="Refresh" Click="btnParseSQL_Click"/>
                    
                    <TextBlock Grid.Column="1" Grid.Row="9"
                               TextAlignment="Right" HorizontalAlignment="Right"
                               Text="Project ID:"/>
                    <ComboBox Grid.Column="3" Grid.Row="9"
                              x:Name="cboProjIDFieldInSQL"/>
                    
                    <TextBlock Grid.Column="1" Grid.Row="11"
                               TextAlignment="Right" HorizontalAlignment="Right"
                               Text="Project Title:"/>
                    <ComboBox Grid.Column="3" Grid.Row="11"
                              x:Name="cboProjTitleFieldInSQL"/>
                    
                </Grid>
            </Controls1:Expander>
            
            <Controls1:Expander Header="Terms">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="4"/>
                        <ColumnDefinition Width="5"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="4"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="60"/>
                        <ColumnDefinition Width="4"/>
                    </Grid.ColumnDefinitions>
                    
                    <Grid.RowDefinitions>
                        <RowDefinition Height="3"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="3"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="3"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="3"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="3"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="3"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="3"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="3"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="3"/>
                    </Grid.RowDefinitions>
                    
                    <TextBlock Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="2"
                               TextAlignment="Right" HorizontalAlignment="Right"
                               Text="Term DB:"/>
                    <TextBox Grid.Column="4" Grid.Row="1"
                             x:Name="txtTermDB" Text="analytics"/>
                    <Button Grid.Column="5" Grid.Row="1"
                            x:Name="btnPopulateTermDBTables" Content="Refresh" Click="btnPopulateTermDBTables_Click"/>
                    
                    <TextBlock Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="2"
                               TextAlignment="Right" HorizontalAlignment="Right"
                               Text="Term table:"/>
                    <ComboBox Grid.Column="4" Grid.Row="3" 
                              x:Name="cboTermTable" SelectionChanged="cboTermTable_SelectionChanged"/>
                    
                    <TextBlock Grid.Column="2" Grid.Row="5"
                               TextAlignment="Right" HorizontalAlignment="Right"
                               Text="Term ID:"/>
                    <ComboBox Grid.Column="4" Grid.Row="5"
                              x:Name="cboTermIDFieldInTermTable"/>
                    
                    <TextBlock Grid.Column="2" Grid.Row="7"
                               TextAlignment="Right" HorizontalAlignment="Right"
                               Text="Phrase:"/>
                    <ComboBox Grid.Column="4" Grid.Row="7"
                              x:Name="cboPhraseFieldInTermTable"/>
                    
                    <TextBlock Grid.Column="1" Grid.Row="9" Grid.ColumnSpan="2"
                               TextAlignment="Right" HorizontalAlignment="Right"
                               Text="Mapping table:"/>
                    <ComboBox Grid.Column="4" Grid.Row="9"
                              x:Name="cboMappingTable" SelectionChanged="cboMappingTable_SelectionChanged"/>
                    
                    <TextBlock Grid.Column="2" Grid.Row="11"
                               TextAlignment="Right" HorizontalAlignment="Right"
                               Text="Term ID"/>
                    <ComboBox Grid.Column="4" Grid.Row="11"
                              x:Name="cboTermIDFieldInMappingTable"/>
                    
                    <TextBlock Grid.Column="2" Grid.Row="13"
                               TextAlignment="Right" HorizontalAlignment="Right"
                               Text="Project ID"/>
                    <ComboBox Grid.Column="4" Grid.Row="13"
                              x:Name="cboProjIDFieldInMappingTable"/>
                    
                    <TextBlock Grid.Column="2" Grid.Row="15"
                               TextAlignment="Right" HorizontalAlignment="Right"
                               Text="Term freq"/>
                    <ComboBox Grid.Column="4" Grid.Row="15"
                              x:Name="cboTermFreqFieldInMappingTable"/>
                </Grid>
            </Controls1:Expander>

            <Controls1:Expander Header="Terms">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="4"/>
                        <ColumnDefinition Width="5"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="4"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="60"/>
                        <ColumnDefinition Width="4"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="3"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="3"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="3"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="3"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="3"/>
                    </Grid.RowDefinitions>
                    
                    <TextBlock Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="2"
                               TextAlignment="Right" HorizontalAlignment="Right"
                               Text="Result DB:"/>
                    <TextBox Grid.Column="4" Grid.Row="1"
                             x:Name="txtResultDB" Text="analytics"/>
                    <Button Grid.Column="5" Grid.Row="1"
                            x:Name="btnGetResultDBTables" Content="Refresh"
                            Click="btnGetResultDBTables_Click"/>
                    
                    <TextBlock Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="2"
                               TextAlignment="Right" HorizontalAlignment="Right"
                               Text="Result table:"/>
                    <ComboBox Grid.Column="4" Grid.Row="3"
                              x:Name="cboResultTable" 
                              SelectionChanged="cboResultTable_SelectionChanged"/>
                    
                    <TextBlock Grid.Column="2" Grid.Row="5"
                               TextAlignment="Right" HorizontalAlignment="Right"
                               Text="Task:"/>
                    <ComboBox Grid.Column="4" Grid.Row="5"
                              x:Name="cboTaskField"/>
                    
                    <TextBlock Grid.Column="2" Grid.Row="7"
                               TextAlignment="Right" HorizontalAlignment="Right"
                               Text="Output:"/>
                    <ComboBox Grid.Column="4" Grid.Row="7"
                              x:Name="cboOutputField"/>
                </Grid>
            </Controls1:Expander>
        </StackPanel>
        
        <Button x:Name="CancelButton" Content="Cancel" Click="CancelButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,0,0" Grid.Row="1" />
        <Button x:Name="OKButton" Content="OK" Click="OKButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,79,0" Grid.Row="1" />
    </Grid>
</Components:ComponentEditorBase>